﻿Public Class Form1
  Public coloreSfondo As New Color
  Private Sub Form1_Load(ByVal sender _
           As System.Object, _
           ByVal e As System.EventArgs) _
           Handles MyBase.Load
    ' Nessuna operazione al caricamento
    ' del form
  End Sub
  Private Sub Form1_Click(ByVal sender _
           As Object, _
           ByVal e As System.EventArgs) _
           Handles Me.Click
    MessageBox.Show("Clic!")
  End Sub
  Private Sub Button1_MouseHover(ByVal sender _
           As Object, _
           ByVal e As System.EventArgs) _
           Handles Button1.MouseHover
    coloreSfondo = Me.BackColor
    Me.BackColor = Color.Red
  End Sub
  Private Sub Button1_MouseLeave(ByVal sender _
           As Object, _
           ByVal e As System.EventArgs) _
           Handles Button1.MouseLeave
    Me.BackColor = coloreSfondo
  End Sub
End Class
